package arithmetic.thread;

import java.util.concurrent.CountDownLatch;

/**
 * @author jiangfeng 2019/7/15 23:57
 */
public class CountDownLatchDome {
    public static void main(String[] args) throws InterruptedException {
         CountDownLatch countDownLatch = new CountDownLatch(6);

        for (int i = 0; i < 6; i++) {
            new Thread(()->{countDownLatch.countDown();
                System.out.println(Thread.currentThread().getName()+" -1");},String.valueOf(i)).start();
        }

        countDownLatch.await();
        System.out.println("减完了");

    }


}
